SEMI_NAME := sumsung
CHIP_NAME := s3c2440

BSPC_INCS_ROOT := ../bsp/common/h
BSPC_SRCS_ROOT := ../bsp/common/src/
BSPB_INCS_ROOT := ../bsp/board/$(SEMI_NAME)/$(CHIP_NAME)/h
BSPB_SRCS_ROOT := ../bsp/board/$(SEMI_NAME)/$(CHIP_NAME)/src/

BSPC_INCS := $(BSPC_INCS_ROOT)/driver/ \
			$(BSPC_INCS_ROOT)/machine/ \
			$(BSPC_INCS_ROOT)/mem/
BSPC_SRCS := $(BSPC_SRCS_ROOT)/driver/ \
			$(BSPC_SRCS_ROOT)/machine/ \
			$(BSPC_SRCS_ROOT)/mem/

BSPB_INCS := $(BSPB_INCS_ROOT)/console/ \
			$(BSPB_INCS_ROOT)/cpu/ \
			$(BSPB_INCS_ROOT)/driver/ \
			$(BSPB_INCS_ROOT)/intrpt/ \
			$(BSPB_INCS_ROOT)/machine/
BSPB_SRCS := $(BSPB_SRCS_ROOT)/console/ \
			$(BSPB_SRCS_ROOT)/driver/ \
			$(BSPB_SRCS_ROOT)/intrpt/ \
			$(BSPB_SRCS_ROOT)/machine/

BSP_ALL_INCS := $(BSPC_INCS_ROOT) \
				$(BSPB_INCS_ROOT) \
				$(BSPC_INCS) \
				$(BSPB_SRCS)
BSP_ALL_SRCS := $(BSPC_SRCS_ROOT) \
				$(BSPB_SRCS_ROOT) \
				$(BSPC_SRCS) \
				$(BSPB_SRCS)

INC_DIRS := $(BSP_ALL_INCS)
SRC_DIRS := $(BSP_ALL_SRCS)

H_FILES := $(patsubst %, -I %, $(INC_DIRS))
C_FILES := $(SRC_DIRS)
S_FILES := $(SRC_DIRS)

CBUILD_PATH = $(C_FILES)
SBUILD_PATH = $(S_FILES)
HEADFILE_PATH = $(H_FILES)

# 编译生成文件存储路径
OBJOUT_PATH = ../build/obj

include buildcmd.mki
include buildobjs.mki

# 目标依赖关系
.PHONY : all everything build_bsp

all : build_bsp
build_bsp : everything
everything : $(BUILD_MK_BSPS_OBJS)

include buildrule.mki